package com.laicunba.ext.web.init;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;
import org.springframework.web.context.ServletConfigAware;

import com.laicunba.constant.GloabConstant;

public class SysInitServlet implements ServletContextListener, ServletConfigAware {
	private static final Logger LOG = Logger.getLogger(SysInitServlet.class);

	@Override
	public void setServletConfig(ServletConfig servletConfig) {
	}

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		PropertiesInit.init();
		LOG.info("sprint init success");
		sce.getServletContext().setAttribute("pubkey", GloabConstant.RSA_PUBLIC_KEY);
		sce.getServletContext().setAttribute("h5path", GloabConstant.H5_PATH);
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {

	}

}
